#!/usr/bin/env python
# coding: utf-8
from utils.weiboloader import *
from utils.dataloader_utils import *
from model.Sent2Vec import *
import pandas as pd

for i in [1, 5, 6]:
    df = pd.read_csv('./data/weibo_ids.csv')
    dev_te = df[df.category==i]
    shape = dev_te.shape

    tr_df = df[df.category!=i]
    dev_df = dev_te.iloc[:int(shape[0]/2)]
    te_df = dev_te.iloc[int(shape[0]/2):]

    tr = WeiboSet()
    tr.load_data(weibo_dir="../data/Weibo/", weibo_df=tr_df)
    tr.Caches_Data(data_prefix="./data/weibo_tr_%s"%topics[i])

    dev = WeiboSet()
    dev.load_data(weibo_dir="../data/Weibo/", weibo_df=dev_df)
    dev.Caches_Data(data_prefix="./data/weibo_dev_%s"%topics[i])

    te = WeiboSet()
    te.load_data(weibo_dir="../data/Weibo/", weibo_df=te_df)
    te.Caches_Data(data_prefix="./data/weibo_te_%s"%topics[i])